{
 "metadata": {
  "name": "",
  "signature": "sha256:a9872aab276952d7cb788c0c4d995b6514c362b6c14f1bdc27587e65adfb82f1"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%matplotlib inline \n",
      "import pandas as pd\n",
      "import matplotlib.pyplot as plt\n",
      "import pylab as pl\n",
      "import numpy as np"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "companyinfo = pd.read_csv(\"companysentimentszscore.csv\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "companyinfo.altman.count()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 19,
       "text": [
        "3313"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "distress = altmanzscore[altmanzscore<=1.8]\n",
      "safe = altmanzscore[altmanzscore>=3.0]\n",
      "neutral = altmanzscore[altmanzscore.between(1.8,3)]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 16
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print (distress.count(), safe.count(), neutral.count())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "1032 1690 2722\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print (distress.describe())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "count    1032.000000\n",
        "mean       -1.961134\n",
        "std         9.818075\n",
        "min      -157.210000\n",
        "25%        -1.091750\n",
        "50%         0.663500\n",
        "75%         1.255500\n",
        "max         1.798000\n",
        "Name: altman, dtype: float64\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "raw",
     "metadata": {},
     "source": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print (safe.describe())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "count    1690.000000\n",
        "mean        9.925705\n",
        "std        20.506765\n",
        "min         3.001000\n",
        "25%         4.009500\n",
        "50%         5.404500\n",
        "75%         8.883500\n",
        "max       454.079000\n",
        "Name: altman, dtype: float64\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print (neutral.describe())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "count    591.000000\n",
        "mean       2.374411\n",
        "std        0.337121\n",
        "min        1.801000\n",
        "25%        2.092500\n",
        "50%        2.375000\n",
        "75%        2.663500\n",
        "max        2.997000\n",
        "Name: altman, dtype: float64\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}